package cn.yunhe.action;

import cn.yunhe.entity.Users;
import cn.yunhe.service.UserService;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public class AddUserAction extends BaseAction implements ModelDriven<Object> {
    private Users users;
    public  String execute() throws Exception{
        UserService userService = new UserService();
        int flag = userService.insert(users);
        return SUCCESS;
    }

    public Users getUser() {
        return users;
    }

    public void setUser(Users users) {
        this.users = users;
    }

    @Override
    public Object getModel() {
        if(users==null){
            users = new Users();
        }
        return users;
    }
}
